<template>
	<view class="font explain">
		<view class="edit_title">
			<span style="color: red;">*</span>调查名称
			<uni-easyinput class="uni-mt-5" trim="all" v-model="temporary_title" placeholder="请输入内容" ></uni-easyinput>
			<view class="questionnaire_shows_that">
				<p>调查说明</p>
				<uni-easyinput type="textarea" v-model="temporary_explain" placeholder="请输入内容"></uni-easyinput>
			</view>
		</view>
		<button class="sure" @click="sure">确认</button>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				formid:"",
				temporary_title:"",
				temporary_explain:""
			}
		},
		onLoad:function(option){
			this.temporary_title = option.title
			this.formid = option.formid
			this.temporary_explain = option.explain
		},
		methods:{
			sure(){
				let data = {
					formid:this.formid,
					questionnaireDescription:this.temporary_explain,
					questionnaireName :this.temporary_title
				}
				this.$request('/QuestionnairePageController/updateAddQuestionnaireDescription','POST',data)
				.then(res=>{
					var pages = getCurrentPages();
					var prevPage = pages[pages.length - 2]; //上一个页面
					prevPage.setData({
					        editExplainData:{
								title:this.temporary_title,
								temporary_explain:this.temporary_explain
							}
					})
					uni.navigateBack()
				})
			}
		}
	}
</script>

<style lang="scss">
	.explain{
		.sure{
			background-color: #80b156;
			width: 90%;
			height: 100rpx;
			color: white;
			margin-top: 20rpx;
		}
		.input_box{
			width: 90%;
			border: 1px solid #dcdee0;
			height: 80rpx;
			margin: 30rpx 35rpx;
		}
	}
	.edit_title{
		width: 90%;
		margin: 35rpx 0 40rpx 35rpx;
		line-height:80rpx;
	}
</style>